import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { getLocale } from "@/lib/i18n/server"; import { t } from "@/lib/i18n"; import { getAuthor, listPapers } from "@/lib/papers/queries"; import { PaperRow } from "@/components/paper-items"; export const revalidate = 300; export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { const { slug } = await params; const a = await getAuthor(slug); return a ? { title: a.display_name, alternates: { canonical: `/authors/${slug}` } } : {}; } export default async function AuthorPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const locale = await getLocale(); const d = t(locale); const a = await getAuthor(slug); if (!a) notFound(); const res = await listPapers({ author: [slug], sort: "recent", perPage: 100 }); const links: [string, string | null][] = [[d.authors.website, a.website], [d.authors.orcid, a.orcid ? `https://orcid.org/${a.orcid}` : null], [d.authors.scholar, a.google_scholar], [d.authors.ssrn, a.ssrn_url], [d.authors.github, a.github]]; return (

{d.papers.author}

{a.display_name}

{(locale === "fr" ? a.affiliation_fr : a.affiliation_en) &&

{locale === "fr" ? a.affiliation_fr : a.affiliation_en}{(locale === "fr" ? a.department_fr : a.department_en) ? ` ยท ${locale === "fr" ? a.department_fr : a.department_en}` : ""}

} {(locale === "fr" ? a.bio_fr : a.bio_en) &&

{locale === "fr" ? a.bio_fr : a.bio_en}

}

{res.total} {res.total === 1 ? d.topics.paper : d.authors.papers}

{res.items.map((p) => )}
); }